package com.cn.mapper;

import com.cn.entity.Order;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface OrderMapper {
    int deleteByPrimaryKey(Long id);

    int insert(Order record);

    int insertSelective(Order record);

    Order selectByPrimaryKey(Long id);

    List<Order> getMyOrder(Long userId);

    List<Order> getAllOrder(@Param("begin") int begin, @Param("nums") int nums);

    // 新增方法，用于PageHelper分页
    List<Order> getAllOrderForPage();

    List<Order> getOrderByNumber(@Param("searchValue") String searchValue, @Param("begin") int begin, @Param("nums") int nums);

    // 新增方法，用于PageHelper分页
    List<Order> getOrderByNumberForPage(@Param("searchValue") String searchValue);

    int countAllOrder();

    int updateByPrimaryKeySelective(Order record);

    int updateByPrimaryKey(Order record);

    List<Order> findOrderByIdleIdList(@Param("idleIdList") List<Long> idleIdList);
}
